package com.sleep.ruledemo.service.imol;

import com.sleep.ruledemo.service.ThreadLocalTestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author GuoAo
 * @className ThreadLocalServiceBImpl
 * @date 2025/7/29
 * @description TODO
 */
@Service("testB")
@Slf4j
public class ThreadLocalServiceBImpl implements ThreadLocalTestService {
    ThreadLocal<Map<String,Object>> threadLocal = new ThreadLocal<>();

    @Override
    public void test() {
        Map<String, Object> stringObjectMap = threadLocal.get();
        log.info("获取的线程变量：{} 线程名称：{}", stringObjectMap,Thread.currentThread().getName());
    }
}
